package com.sky.mapper;

import com.sky.annotation.AutoFill;
import com.sky.entity.SetmealDish;
import com.sky.enumeration.OperationType;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * @Author FengHuan Wang
 * @Date 2024/12/30 9:22
 * @Version 1.0
 */
@Mapper
public interface SetMealDishMapper {

    Long getByDishIds(List<Long> ids);

    @AutoFill(value = OperationType.INSERT)
    void add(List<SetmealDish> setmealDishes);

    @Select("select * from setmeal_dish where setmeal_id = #{id}")
    List<SetmealDish> getBySetmealId(Long id);

    @Delete("delete from setmeal_dish where setmeal_id = #{id}")
    void deleteBySetmealId(Long id);

    @AutoFill(value = OperationType.INSERT)
    void insertBySetmealId(List<SetmealDish> setmealDishes);
}
